Skip to content

Allow sending 0-byte DATA frames when flow-control window is negative#1314

Merged
Kriechi merged 1 commit intopython-hyper:masterfrom
lagemeet:fix-flow-control-0-byte-data
May 10, 2026
Merged

Allow sending 0-byte DATA frames when flow-control window is negative#1314
Kriechi merged 1 commit intopython-hyper:masterfrom
lagemeet:fix-flow-control-0-byte-data

Conversation

@lagemeet
Copy link
Copy Markdown

@lagemeet lagemeet commented May 6, 2026

fix empty 0-byte DATA frame broke with FlowControlError

error
Cannot send 0 bytes, flow control window is -49151

RFC allows empty END_STREAM even if window is negative

Frames with zero length with the END_STREAM flag set (that
is, an empty DATA frame) MAY be sent if there is no available space
in either flow-control window.

allow 0-byte frames even when window < 0
only enforce flow-control check if frame_size > 0
skip negative window assert for empty payload in connection.py + stream.py

@Kriechi
Copy link
Copy Markdown
Member

Kriechi commented May 6, 2026

Thanks! Please add a test and changelog entry.

@lagemeet lagemeet force-pushed the fix-flow-control-0-byte-data branch from fda581d to 6545d79 Compare May 7, 2026 18:13
@lagemeet lagemeet force-pushed the fix-flow-control-0-byte-data branch from 6545d79 to 40e3a1a Compare May 7, 2026 18:20
@lagemeet
Copy link
Copy Markdown
Author

lagemeet commented May 8, 2026

added tests and changelog changes to the pull request

@Kriechi Kriechi merged commit b08b9d7 into python-hyper:master May 10, 2026
7 checks passed
@Kriechi
Copy link
Copy Markdown
Member

Kriechi commented May 10, 2026

Thanks! 🎉

@lagemeet
Copy link
Copy Markdown
Author

Thank you too! <3 I found that bug while using the xmpp client called gajim with an haproxy server. it was not possible to send files if the server had an initial window size lower than 65535.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants